package com.zhongwang.mms.module.basic.dao;

import com.zhongwang.mms.gen.entity.TWarehouseInfo;
import com.zhongwang.mms.gen.entity.TWarehouseInfoExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TWarehouseInfoDao {
    long countByExample(TWarehouseInfoExample example);

    int deleteByExample(TWarehouseInfoExample example);

    int deleteByPrimaryKey(Integer whiId);

    int insert(TWarehouseInfo record);

    int insertSelective(TWarehouseInfo record);

    List<TWarehouseInfo> selectByExample(TWarehouseInfoExample example);

    TWarehouseInfo selectByPrimaryKey(Integer whiId);

    int updateByExampleSelective(@Param("record") TWarehouseInfo record, @Param("example") TWarehouseInfoExample example);

    int updateByExample(@Param("record") TWarehouseInfo record, @Param("example") TWarehouseInfoExample example);

    int updateByPrimaryKeySelective(TWarehouseInfo record);

    int updateByPrimaryKey(TWarehouseInfo record);


    /**
     *@FunctionName: findWarehouseInfoByName
     *@Description: 根据仓库代码获取主键
     *@Author: 徐一贺
     *@CreateDate: 2020/3/23 14:36
     *@Phone: 18241927380
     *@Param:
     *@Return:
     *@Version:
     */
    TWarehouseInfo findWarehouseInfoByCode(String code);


    /**
     *@FunctionName: findWarehouseInfoList
     *@Description: 获取库存信息列表
     *@Author: 徐一贺
     *@CreateDate: 2020/3/18 16:55
     *@Phone: 18241927380
     *@Param:
     *@Return: List<TWarehouseInfo> 库存信息列表
     *@Version: 1.0.0
     */
    List<TWarehouseInfo> findWarehouseInfoListByWhiType(String whiType);

    /**
     * 仓库被应用记录
     * @param whiId 仓库id
     * @return
     */
    List<TWarehouseInfo> findWarehouseUsedCount(Integer whiId);

    /**
     *@FunctionName: getTWarehouseInfoBywhiId
     *@Description: 根据主键获取仓库实体
     *@Author: 徐一贺
     *@CreateDate: 2020/6/9 16:10
     *@Phone: 18241927380
     *@Version: v 1.0.0
     */
    TWarehouseInfo getTWarehouseInfoByWhiId(Integer ityWhiId);

    /**
     *@FunctionName: getTWarehouseInfoByWhiName
     *@Description: 根据仓库名获取仓库
     *@DesignIdea: 根据仓库名获取仓库
     *@Author: 徐一贺
     *@CreateDate: 2020/6/16 7:55
     *@Phone: 18241927380
     *@Param: ceoUseWhiName 仓库名
     *@Return: TWarehouseInfo 仓库实体
     *@Throw:
     *@Version: v 1.0.0
     */
    TWarehouseInfo getTWarehouseInfoByWhiName(String ceoUseWhiName);

}